package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	/**
	 * ...
	 * @author Lorenzo Nuvoletta
	 */
	public class Main extends Sprite 
	{
		
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			for (var i:int = 0; i < 100; i++){
				var spr:Sprite = new Sprite();
				spr.graphics.beginFill(0xcc0000);
				spr.graphics.drawCircle(0, 0, 10);
				spr.graphics.endFill();
				addChild(spr);
				spr.x = (i % 12) * 66;
				spr.y = int(i / 12) * 66;
				//new AssetLoader('test.png', { displayObject:spr, convertToBMP:true } );
				new AssetLoader('Asset.swf', { displayObject:spr, convertToBMP:false, className:'Asset', alpha:.5 } );				
			}			
			
		}
		
	}
	
}